Skip to content

test: bypass proxy env in inspector network fetch test#64383

Open
harjothkhara wants to merge 1 commit into
nodejs:mainfrom
harjothkhara:fix/inspector-network-fetch-proxy-env
Open

test: bypass proxy env in inspector network fetch test#64383
harjothkhara wants to merge 1 commit into
nodejs:mainfrom
harjothkhara:fix/inspector-network-fetch-proxy-env

Conversation

@harjothkhara

Copy link
Copy Markdown

test-inspector-network-fetch installs an EnvHttpProxyAgent as the global dispatcher only to disable TLS certificate validation for its local self-signed HTTPS server. However, EnvHttpProxyAgent also honors the ambient http_proxy/https_proxy environment variables, so in an environment where a proxy is configured the requests to http://something.invalid/ are routed through the proxy. This makes the request origin the proxy and the request path an absolute-form target, so the URL reported to Network.requestWillBeSent becomes a malformed concatenation such as
http://127.0.0.1:7769http://something.invalid/, and the assertions on the request URL fail.

Pass noProxy: '*' so the dispatcher never routes through a proxy while still disabling certificate validation, making the test independent of ambient proxy configuration.

`test-inspector-network-fetch` installs an `EnvHttpProxyAgent` as the
global dispatcher only to disable TLS certificate validation for its
local self-signed HTTPS server. However, `EnvHttpProxyAgent` also honors
the ambient `http_proxy`/`https_proxy` environment variables, so in an
environment where a proxy is configured the requests to
`http://something.invalid/` are routed through the proxy. This makes the
request `origin` the proxy and the request `path` an absolute-form
target, so the URL reported to `Network.requestWillBeSent` becomes a
malformed concatenation such as
`http://127.0.0.1:7769http://something.invalid/`, and the assertions on
the request URL fail.

Pass `noProxy: '*'` so the dispatcher never routes through a proxy while
still disabling certificate validation, making the test independent of
ambient proxy configuration.
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants